
<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>utils.Memory</title>
<link rel="stylesheet" type="text/css" href="candydoc/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="candydoc/ie56hack.css"><![endif]-->
<script language="JavaScript" src="candydoc/util.js" type="text/javascript"></script>
<script language="JavaScript" src="candydoc/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="candydoc/explorer.js" type="text/javascript"></script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("utils.Memory", "candydoc/");</script>
	<table class="content">
		<tr><td id="docbody"><h1>utils.Memory</h1><!-- Generated by Ddoc from C:\Projects\necrophilia\tests\shared\utils\Memory.d -->
<br><br>

<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">alloc</span>
<script>explorer.outline.addDecl('alloc');</script>

(T,intT)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Allocate the array using malloc
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">array</td>

               
<td>the array which will be resized</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">numItems</td>

               
<td>number of items to be allocated in the array</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">init</td>

               
<td>whether to init the allocated items to their default values or not</td></tr>
</table><br>
<b>Examples:</b><br>
int[] foo;
	foo.
<span class="currsymbol">alloc</span>
<script>explorer.outline.addDecl('alloc');</script>

(20);

<br><br>
<b>Remarks:</b><br>
The array must be <b>null</b> and empty for this function to succeed. The rationale behind this is that the coder should state his decision clearly. This will help and has
	already helped to spot many intricate bugs.
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">
<span class="currsymbol">alloc</span>
<script>explorer.outline.addDecl('alloc');</script>

</span>
<script>explorer.outline.addDecl('
<span class="currsymbol">alloc</span>
<script>explorer.outline.addDecl('alloc');</script>

');</script>

(T,intT)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Allocate the <span class="funcparam">array</span> using malloc
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">T <span class="funcparam">array</span></td>

               
<td>the <span class="funcparam">array</span> which will be resized</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">intT <span class="funcparam">numItems</span></td>

               
<td>number of items to be allocated in the <span class="funcparam">array</span></td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">bool <span class="funcparam">init</span></td>

               
<td>whether to <span class="funcparam">init</span> the allocated items to their default values or not</td></tr>
</table><br>
<b>Examples:</b><br>
int[] foo;
	foo.
<span class="currsymbol">alloc</span>
<script>explorer.outline.addDecl('alloc');</script>

(20);

<br><br>
<b>Remarks:</b><br>
The <span class="funcparam">array</span> must be <b>null</b> and empty for this function to succeed. The rationale behind this is that the coder should state his decision clearly. This will help and has
	already helped to spot many intricate bugs.
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">clone</span>
<script>explorer.outline.addDecl('clone');</script>

(T)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Clone the given array. The result is allocated using alloc() and copied piecewise from the param. Then it's returned
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">
<span class="currsymbol">clone</span>
<script>explorer.outline.addDecl('clone');</script>

</span>
<script>explorer.outline.addDecl('
<span class="currsymbol">clone</span>
<script>explorer.outline.addDecl('clone');</script>

');</script>

(T)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Clone the given <span class="funcparam">array</span>. The result is allocated using alloc() and copied piecewise from the param. Then it's returned
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">realloc</span>
<script>explorer.outline.addDecl('realloc');</script>

(T,intT)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Realloc the contents of an array
<br><br>
array = the array which will be resized
	numItems = the new size for the array
	init = whether to init the newly allocated items to their default values or not

<br><br>
<b>Examples:</b><br>
int[] foo;
	foo.alloc(20);
	foo.
<span class="currsymbol">realloc</span>
<script>explorer.outline.addDecl('realloc');</script>

(10);		// &lt;--
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">
<span class="currsymbol">realloc</span>
<script>explorer.outline.addDecl('realloc');</script>

</span>
<script>explorer.outline.addDecl('
<span class="currsymbol">realloc</span>
<script>explorer.outline.addDecl('realloc');</script>

');</script>

(T,intT)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Realloc the contents of an <span class="funcparam">array</span>
<br><br>
<span class="funcparam">array</span> = the <span class="funcparam">array</span> which will be resized
	<span class="funcparam">numItems</span> = the new size for the <span class="funcparam">array</span>
	<span class="funcparam">init</span> = whether to <span class="funcparam">init</span> the newly allocated items to their default values or not

<br><br>
<b>Examples:</b><br>
int[] foo;
	foo.alloc(20);
	foo.
<span class="currsymbol">realloc</span>
<script>explorer.outline.addDecl('realloc');</script>

(10);		// &lt;--
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">free</span>
<script>explorer.outline.addDecl('free');</script>

(T)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Deallocate an array allocated with alloc()
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">
<span class="currsymbol">free</span>
<script>explorer.outline.addDecl('free');</script>

</span>
<script>explorer.outline.addDecl('
<span class="currsymbol">free</span>
<script>explorer.outline.addDecl('free');</script>

');</script>

(T)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Deallocate an <span class="funcparam">array</span> allocated with alloc()
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">append</span>
<script>explorer.outline.addDecl('append');</script>

(T,I)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Append an item to an array. Optionally keep track of an external 'real length', while doing squared reallocation of the array
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">array</td>

               
<td>the array to 
<span class="currsymbol">append</span>
<script>explorer.outline.addDecl('append');</script>

 the item to</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">elem</td>

               
<td>the new item to be appended</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">realLength</td>

               
<td>the optional external 'real length'</td></tr>
</table><br>
<b>Remarks:</b><br>
if realLength isn't <b>null</b>, the array is not resized by one, but allocated in a std::vector manner. The array's length becomes it's capacity, while 'realLength'
	is the number of items in the array.

<br><br>
<b>Examples:</b><br>
<pre class="d_code">	<font color=blue>uint</font> barLen = 0;
	<font color=blue>int</font>[] bar;
	<u>append</u>(bar, 10, &amp;barLen);
	<u>append</u>(bar, 20, &amp;barLen);
	<u>append</u>(bar, 30, &amp;barLen);
	<u>append</u>(bar, 40, &amp;barLen);
	<font color=blue>assert</font> (bar.length == 16);
	<font color=blue>assert</font> (barLen == 4);
</pre>
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">template 
<span class="currsymbol">
<span class="currsymbol">append</span>
<script>explorer.outline.addDecl('append');</script>

</span>
<script>explorer.outline.addDecl('
<span class="currsymbol">append</span>
<script>explorer.outline.addDecl('append');</script>

');</script>

(T,I)</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Append an item to an <span class="funcparam">array</span>. Optionally keep track of an external 'real length', while doing squared reallocation of the <span class="funcparam">array</span>
<br><br>
<b>Params:</b><br>
<table><tr>
<td nowrap valign="top" style="padding-right: 8px">T <span class="funcparam">array</span></td>

               
<td>the <span class="funcparam">array</span> to 
<span class="currsymbol">append</span>
<script>explorer.outline.addDecl('append');</script>

 the item to</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">I <span class="funcparam">elem</span></td>

               
<td>the new item to be appended</td></tr>
<tr>
<td nowrap valign="top" style="padding-right: 8px">uint* <span class="funcparam">realLength</span></td>

               
<td>the optional external 'real length'</td></tr>
</table><br>
<b>Remarks:</b><br>
if <span class="funcparam">realLength</span> isn't <b>null</b>, the <span class="funcparam">array</span> is not resized by one, but allocated in a std::vector manner. The <span class="funcparam">array</span>'s length becomes it's capacity, while '<span class="funcparam">realLength</span>'
	is the number of items in the <span class="funcparam">array</span>.

<br><br>
<b>Examples:</b><br>
<pre class="d_code">	<font color=blue>uint</font> barLen = 0;
	<font color=blue>int</font>[] bar;
	<u>append</u>(bar, 10, &amp;barLen);
	<u>append</u>(bar, 20, &amp;barLen);
	<u>append</u>(bar, 30, &amp;barLen);
	<u>append</u>(bar, 40, &amp;barLen);
	<font color=blue>assert</font> (bar.length == 16);
	<font color=blue>assert</font> (barLen == 4);
</pre>
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</td></tr>
		<tr><td id="docfooter">
			Page was generated with
			<img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px">
			on Wed Mar 21 02:44:07 2007

		</td></tr>
	</table>
</div>
<script>
   explorer.packageExplorer.addModule("necrophilia.Exception");
   explorer.packageExplorer.addModule("necrophilia.Time");
   explorer.packageExplorer.addModule("necrophilia.helpers.Callback");
   explorer.packageExplorer.addModule("necrophilia.helpers.Interpolation");
   explorer.packageExplorer.addModule("necrophilia.helpers.ListArray");
   explorer.packageExplorer.addModule("necrophilia.animation.Base");
   explorer.packageExplorer.addModule("necrophilia.animation.DataNodes");
   explorer.packageExplorer.addModule("necrophilia.animation.Instance");
   explorer.packageExplorer.addModule("necrophilia.animation.Inteligent");
   explorer.packageExplorer.addModule("necrophilia.skeleton.DataNodes");
   explorer.packageExplorer.addModule("necrophilia.skeleton.Bone");
   explorer.packageExplorer.addModule("necrophilia.skeleton.Skeleton");</script>
</body></html>


